package com.dukk.espark.core;

import org.apache.spark.scheduler.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 *  统计任务监听类
 *  todo://未来规划进行监控等进行丰富
 *
 * @version 2020-08-10
 * @author shengshi_feiyang@yeah.net
 */
public class EngineListener extends SparkListener {

    private static final Logger logger = LoggerFactory.getLogger(EngineListener.class);

    private String appName;


    @Override
    public void onApplicationStart(SparkListenerApplicationStart applicationStart) {
         this.appName = applicationStart.appName();
         logger.info("任务启动成功,任务名称[{}]", this.appName);
    }

    @Override
    public void onApplicationEnd(SparkListenerApplicationEnd applicationEnd) {
        logger.info("任务统计结束,任务名称[{}]", this.appName);
    }

}
